<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>用户注册</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#pwd2").change(function(){
				var b = check();
			});
			
		});
		function check(){
			var pwd1 = $("#pwd1").attr("value");
			var pwd2 = $("#pwd2").attr("value");
			if(pwd1 == pwd2){
				$("#tag").html("密码一致");
				$("#tag").css("color","green");
				return true;
			}else{
				$("#tag").html("密码不一致");
				$("#tag").css("color","red");
				return false;
			}
		}
	</script>
  </head>
  
  <body>
  	<form action="<%=basePath %>/user/userReg" method="post">
    <table border="1" align="center">
    	<thead>
    		<tr>
    			<td colspan="3" align="center">用户注册</td>
    		</tr>
    	</thead>
    	<tbody>
    		<tr>
    			<th id="reg_title" colspan="3" align="center">基本信息填写</th>
    		</tr>
    		<tr>
    			<td align="right">用户名:</td>
    			<td><input id="userid" type="text" name="userid"/></td>
    			<td><p>*必填项</p></td>
    		</tr>
    		<tr>
    			<td align="right">密码:</td>
    			<td><input id="pwd1" type="password" name="userpassword"/></td>
    			<td><p>*必填项</p></td>
    		</tr>
    		<tr>
    			<td align="right">密码确认:</td>
    			<td><input id="pwd2" type="password"/></td>
    			<td><p id=tag>*必填项</p></td>
    		</tr>
    		<tr>
    			<td align="right">昵称:</td>
    			<td><input type="text" name="username"/></td>
    			<td><p>*必填项</p></td>
    		</tr>
    		<tr>
    			<td align="right">性别:</td>
    			<td><select name="usersex">
    				<option selected="selected" value="男">男</option>
    				<option>女</option>
    			</select>
    			<td><p>*必填项</p></td>
    		</tr>
    		<tr>
    			<th id="reg_title" align="center" colspan="3">密码保护设置</th>
    		</tr>
    		<tr>
    			<td align="right">密保问题:</td>
    			<td><input type="text"/></td>
    			<td><p>*必填项</p></td>
    		</tr>
    		<tr>
    			<td align="right">密保答案:</td>
    			<td><input type="text"/></td>
    			<td><p>*必填项</p></td>
    		</tr>
    	</tbody>
    	<tfoot>
    		<tr>
    			<td id="btn" colspan="3" align="center"><input type="submit" value="注册"/></td>
    		</tr>
    	</tfoot>
    </table>
    </form>
  </body>
</html>
